import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'
const routes = [
  {
    path: '',
    redirect: '/item'
  },
  {
    path: '/Home',
    name: 'Home',
    component: Home,
    children:[ 
      {
        path: '/bodyContent',
        name: 'bodyContent',
        component: ()=>import('../components/body/bodyContent.vue'),
        children:[
          //总产品
          {
            path: '/item',
            name: 'item',
            component: ()=>import('../components/body/itemList/item.vue')
          },            
          //产品预览
          {
            path: '/productView',
            name: 'productView',
            component: ()=>import('../components/body/productView/productView.vue')
          },           
        ]
      }, 
      {
        path: '/Login',
        name: 'Login',
        component: ()=>import('../components/login.vue')
      },             
    ]
  },
  //搜索框
  {
    path:'/searchBar',
    name:'searchBar',
    component: ()=>import ('../components/searchBar')
  },  

]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
